import { StockDataCrawler } from '../services/StockDataCrawler';

async function testCrawler() {
  console.log('🧪 开始手动测试股票数据爬虫...');
  
  const crawler = new StockDataCrawler({
    batchSize: 5, // 减少批次大小用于测试
    delayBetweenBatches: 1000
  });

  try {
    console.log('\n=== 步骤1: 初始化市场数据 ===');
    await crawler.initializeMarketData();
    
    console.log('\n=== 步骤2: 更新实时数据 ===');
    await crawler.updateRealtimeData();
    
    console.log('\n=== 步骤3: 更新历史数据 ===');
    await crawler.updateDailyData();
    
    console.log('\n✅ 测试完成！');
  } catch (error: any) {
    console.error('❌ 测试失败:', error.message);
  }
}

// 运行测试
testCrawler();